package com.example.mapper;

import com.example.pojo.TbBook;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Author:20201002983_郑雨蓓
 * Date: 2022/12/14
 * Description:
 */
@Mapper
@Repository
public interface TbBookMapper {
    //    @Select("select * from tb_book")
    List<TbBook> list();

    //书籍id
    TbBook selectById(@Param("bookId") Long bookId);

    //分类标签
//    @Select("select * from tb_book where category_id = #{cid)")
    List<TbBook> selectByCategoryId(@Param("categoryId") Long cid);

    //    @Select("select * from tb_book where book_name like Concat('$',#{bookName},'$')")
    List<TbBook> selectByName(@Param("bookName") String bookName);

    List<TbBook> selectByMulCon(TbBook tbBook);

    int add(@Param("book") TbBook tbBook);

    int update(@Param("book") TbBook tbBook);

    int delete(Long id);
}
